]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overview: Handle sessionMode.hasOverview changes
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 29 Nov 2012 16:58:31 +0000 (17:58 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 29 Nov 2012 20:31:06 +0000 (21:31 +0100)
Currently we assume that either the initial sessionMode will have
the overview or none of the pushed modes - starting without the
overview and pushing a mode that adds it fails spectacularly.
However this is exactly what we are going to do when loading external
modes asynchronously - we'll initially use the default mode while
the modes are loading, and switch to the mode passed on the command
line when finished. So make sure that the overview UI gets initialized
properly in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=689304

js/ui/overview.js

index 3f1663f335e18d42b7baaee2be71ceaae4d605d1..3c1f03058c5c28fe29f7714c11fa506128bdb5a8 100644 (file)
@@ -117,6 +117,7 @@ const Overview = new Lang.Class({
 
     _init: function() {
         this._overviewCreated = false;
+        this._initCalled = false;
 
         Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
         this._sessionUpdated();
@@ -204,6 +205,9 @@ const Overview = new Lang.Class({
         this._lastActiveWorkspaceIndex = -1;
         this._lastHoveredWindow = null;
         this._needsFakePointerEvent = false;
+
+        if (this._initCalled)
+            this.init();
     },
 
     _sessionUpdated: function() {
@@ -216,6 +220,8 @@ const Overview = new Lang.Class({
     // signal handlers and so forth. So we create them after
     // construction in this init() method.
     init: function() {
+        this._initCalled = true;
+
         if (this.isDummy)
             return;